package view;

import java.util.ArrayList;
import java.util.List;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;

import dto.TaskDto;

@ManagedBean(name="TaskListBean")
@SessionScoped
public class TaskListBean {
	private List<TaskDto> dataList;

	public void loadDataList(){
		dataList = new ArrayList<TaskDto>();
		TaskDto data1 = new TaskDto();
        data1.setTaskInstanceId(1000l);
        data1.setActorId("Willy smith");
        data1.setTaskNode("In Charge");
        data1.setDescription("CR 123456");

        TaskDto data2 = new TaskDto();
        data2.setTaskInstanceId(1001l);
        data2.setActorId("Frank Sinatra");
        data2.setTaskNode("Rejected");
        data2.setDescription("CR 654321");

        dataList.add(data1);
        dataList.add(data2);
	}
	
	public List<TaskDto> getDataList() {
		loadDataList();
		return dataList;
	}

	public void setDataList(List<TaskDto> dataList) {
		this.dataList = dataList;
	}
}
